package com.ansion.commonchat.contact.model;

import com.ansion.basedb.dao.model.BaseModel;
import com.ansion.basedb.dao.model.DatabaseField;
import com.ansion.log.VLog;

/**
 * alvin
 */
public class MatchContactModel extends BaseModel implements Cloneable{
	/**
     * 
     */
	private static final long serialVersionUID = 1L;
	public static final String kColumnName_phone_key = "phone_key";
	public static final String kColumnName_name = "name";
	public static final String kColumnName_uid = "uid";
	public static final String kColumnName_matched = "matched";
	
	public static final String kColumnName_newAdd = "newAdd";

	@DatabaseField(columnName = kColumnName_phone_key, unique = true, canBeNull = false, index = true)
	private String phone;

	@DatabaseField(columnName = kColumnName_name)
	private String name;

	@DatabaseField(columnName = kColumnName_uid)
	private long uid;


	@DatabaseField(columnName = kColumnName_matched)
	private int matched;
	
	@DatabaseField(columnName = kColumnName_newAdd)
	private int newAdd;

	public MatchContactModel() {
		super();
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setMatched(boolean matched) {
		this.matched = matched ? 1 : 0;
	}

	public boolean isMatched() {

		return matched == 1;
	}
	
	public void setNewAdd(boolean newAdd) {
		this.newAdd = newAdd ? 1 : 0;
	}

	public boolean isNewAdd() {

		return newAdd == 1;
	}
	
	public long getUid() {
		return uid;
	}
	
	public void setUid(long uid) {
		this.uid = uid;
	}
	
	public MatchContactModel clone() {
		MatchContactModel o = null;
		try {
			o = (MatchContactModel) super.clone();
		} catch (Exception e) {
			VLog.eonly(e);
		}
		return o;
	}

	@Override
	public String toString() {
		return "MatchContactModel [phone=" + phone + ", name=" + name
				+ ", uid=" + uid + ", matched=" + matched + ", newAdd="
				+ newAdd + "]";
	}
}